package org.shilong.UI.party;

import org.shilong.UI.R;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;

/**
 * 评论聚会屏幕
 * @author cesc
 *
 */
public class CommentPartyFrame extends Activity implements OnClickListener {

	private ImageView closeButtonImageView;
	@Override
	protected void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);

		setContentView( R.layout.layout_comment_party_content );

		initViews();

	}
	private void initViews() {
		// TODO Auto-generated method stub
		closeButtonImageView = (ImageView)this.findViewById(  R.id.close_button_cross_imageview );
		
		closeButtonImageView.setOnClickListener( this );
	}
	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub

		switch ( v.getId()) {
		case R.id.close_button_cross_imageview:

			closeLogic();

			break;

		default:
			break;
		}

	}

	private void closeLogic(){

		Animation anim = AnimationUtils.loadAnimation( this, R.anim.anim_close_button_close );

		anim.setAnimationListener( new Animation.AnimationListener() {
			
			@Override
			public void onAnimationStart(Animation arg0) {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void onAnimationRepeat(Animation arg0) {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void onAnimationEnd(Animation arg0) {
				// TODO Auto-generated method stub
				
				CommentPartyFrame.this.finish();
				
			}
		});
		

		closeButtonImageView.startAnimation( anim);
	}
}
